import http from '@/utils/request.js'

export default {
    createOrder: (obj) => {
        return http({
            url: '/api/order/addOrder',
            method: 'post',
            data: obj
        }
        )
    },
    getOrderById: (id) => {
        return http({
            url: '/api/order/getOrderById',
            method: 'get',
            params: {
                id: id
            }
        }
        )
    },
    getProductById: (id) => {
        return http({
            url: `/api/order/getProductById/${id}`,
            method: 'get',
        }
        )
    },
    updateSetPayTime: (id) => {
        return http({
            url: '/api/order/updateSetPayTime',
            method: 'put',
            params: {
                id: id
            }
        }
        )
     },
    getOrderList: (status) => {
        return http({
            url: `/api/order/getOrderList/${status}`,
            method: 'get',
        }
        )
    },
    updateDeliveryTime: (id) => {
        return http({
            url: `/api/order/updateDeliveryTime/${id}`,
            method: 'put',
        }
        )
    },
    deleteOrder: (id) => {
        return http({
            url: `/api/order/deleteOrder/${id}`,
            method: 'put',
        }
        )
    },
    getUserOrderList: (status) => {
        return http({
            url: `/api/order/getUserOrderList/${status}`,
            method: 'get',
        }
        )
    },
    completeOrder: (id) => {
        return http({
            url: `/api/order/completeOrder/${id}`,
            method: 'put',
        }
        )
    },
    getOrderCount: () => {
        return http({
            url: `/api/order/getOrderCount`,
            method: 'get',
        }
        )
    },

}